import React, { Component } from 'react'
import News from '../News'
import Message from '../Message'
import MyNavLink from "../MyNavLink";
import Detail from '../Detail';

import { Route, Switch, Redirect } from "react-router-dom";

export default class Home extends Component {
  render() {
    return (
      <div>
        <h3>this is Home</h3>
        <MyNavLink className="list-group-item " to="/home/news">
          News
        </MyNavLink>
        <MyNavLink className="list-group-item " to="/home/message">
          Message
        </MyNavLink>
        <Switch>
          <Route path="/home/news" component={News}></Route>
          <Route path="/home/message" component={Message}></Route>
          <Redirect to="/home"></Redirect>
        </Switch>
      </div>
    )
  }
}
